import Vue from 'vue'
import VueRouter from 'vue-router'
// import Home from '../views/Home.vue'

Vue.use(VueRouter)


// 解决重复点击导航路由报错
const originalPush = VueRouter.prototype.push;
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err);
}

const routes = [
  { path: '/', redirect: '/home'},
  { path: '/home',meta:{title:"范永升全国名中医工作室"}, component: () => import('../views/Home')},
  // 工作室介绍
  { path: '/studioIntro',meta:{title:"工作室介绍-范永升全国名中医工作室"}, component: () => import('../views/StudioIntro')},
  // 名医风采
  { path: '/famousdoctor', meta:{title:"名医风采-范永升全国名中医工作室"},component: () => import('../views/famousDoctor')},
  // 论文著作
  { path: '/thesis', meta:{title:"论文著作-范永升全国名中医工作室"}, component: () => import('../views/Thesis')},
   // 论文著作详情页
   { path: '/thesisDetail/:id', meta:{title:"论文著作详情页-范永升全国名中医工作室"}, component: () => import('../views/ThesisDetail')},
  // 临床医案
  { path: '/medicalrecord', meta:{title:"临床医案-范永升全国名中医工作室"}, component: () => import('../views/MedicalRecord')},
   // 临床医案详情页
   { path: '/medicalrecordDetail/:id', meta:{title:"临床医案详情页-范永升全国名中医工作室"}, component: () => import('../views/medicalrecordDetail')},
   // 视频资料
  { path: '/videoMaterial', meta:{title:"视频资料-范永升全国名中医工作室"}, component: () => import('../views/VideoMaterial')},
  // 视频资料详情页
  { path: '/videoMaterialDetail/:id', meta:{title:"视频资料详情页-范永升全国名中医工作室"}, component: () => import('../views/VideoMaterialDetai')},
  // 传承之路
  { path: '/heritageroad', meta:{title:"传承之路-范永升全国名中医工作室"}, component: () => import('../views/HeritageRoad')},
  // 传承之路详情页
  { path: '/heritageroadDetail/:id', meta:{title:"传承之路详情页-范永升全国名中医工作室"}, component: () => import('../views/HeritageRoadDetail')},
  // 名医工作站
  { path: '/medicalwork', meta:{title:"名医工作站-范永升全国名中医工作室"}, component: () => import('../views/MedicalWork')},
  // 名医工作站详情页
  // { path: '/medicalworkDetail/:id', meta:{title:"名医工作站-范永升全国名中医工作室"}, component: () => import('../views/MedicalWorkDetail')},
  // 首页-最新动态
  { path: '/newActivity', meta:{title:"最新动态-范永升全国名中医工作室"}, component: () => import('../views/newActivity')},
   // 首页-最新动态详情页
   { path: '/newActivityDetail/:id', meta:{title:"最新动态详情页-范永升全国名中医工作室"}, component: () => import('../views/newActivityDetail')},
   // 首页-通知公告
  { path: '/notice', meta:{title:"通知公告-范永升全国名中医工作室"}, component: () => import('../views/notice')},
   // 首页-通知公告详情页
   { path: '/noticeDetail/:id', meta:{title:"通知公告详情页-范永升全国名中医工作室"}, component: () => import('../views/noticeDetail')},
   // 首页-获奖情况
  { path: '/awards', meta:{title:"获奖情况-范永升全国名中医工作室"}, component: () => import('../views/awards')},
   // 首页-获奖情况详情页
   { path: '/awardsDetail/:id', meta:{title:"获奖情况-范永升全国名中医工作室"}, component: () => import('../views/awardsDetail')},
  ]
const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
